<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
	</head>
	<body>
		<script>
			var shirtprice=245;
			var shirtcount=2;
			var shoesprice=570;
			var shoescount=10;
			var paiprice=320;
			var paicount=1;
			var discount=0.8;
			var usermoney=5300;
			var totalmoney=shirtprice*shirtcount+shoesprice*shoescount+paiprice*paicount;
			
			document.write("<table align='center' width='300px'>")
			document.write("<tr>")
			document.write("<td colspan='4' align='center'>")
			document.write("*******消费单*******")
			document.write("</td>")
			document.write("</tr>")
			
			document.write("<tr><td>购买物品</td>")
			document.write("<td>单价</td>")
			document.write("<td>数量</td>")
			document.write("<td>金额</td></tr>")
			
			document.write("<tr><td>T恤</td>")
			document.write("<td>&yen"+shirtprice+"</td>")
			document.write("<td>"+shirtcount+"</td>")
			document.write("<td>&yen"+shirtprice*shirtcount+"</td></tr>")
			
			document.write("<tr><td>网球拍</td>")
			document.write("<td>&yen"+shoesprice+"</td>")
			document.write("<td>"+shoescount+"</td>")
			document.write("<td>&yen"+shoesprice*shoescount+"</td></tr>")
			
			document.write("<tr><td>网球鞋</td>")
			document.write("<td>&yen"+paiprice+"</td>")
			document.write("<td>"+paicount+"</td>")
			document.write("<td>&yen"+paiprice*paicount+"</td></tr>")
			
			document.write("<tr><td colspan='4'>&nbsp;</td></tr>")
	
			document.write("<tr><td>折扣：</td>")
			document.write("<td colspan='3'>"+discount*10+"折</td></tr>")
			
			document.write("<tr><td>消费总金额：</td>")
			document.write("<td colspan='3'>&yen"+totalmoney*discount+"</td></tr>")
			
			document.write("<tr><td>实际交费：</td>")
			document.write("<td colspan='3'>&yen"+usermoney+"</td></tr>")
			
			document.write("<tr><td>找零：</td>")
			document.write("<td colspan='3'>&yen"+(usermoney-totalmoney*discount)+"</td></tr>")

			
			document.write("</table>")
		</script>
	</body>
</html>
